<template>
  <section class="smart-bill">
    <process-statistics :data-list="processStatisticsData"/>
    <section class="common-block-section">
      <el-row :gutter="20">
        <el-col :span="2"><div id="cname">客户名称: </div></el-col>
        <el-col :span="10"><div><el-input v-model="cName" placeholder="请输入内容"></el-input></div></el-col>
        <el-col :span="6"><div><el-button type="primary" @click="rollback">确认重置</el-button></div></el-col>
      </el-row>
    </section>
    </section>
</template>
<script>

import processStatistics from "@/components/process-statistics";
import dataHelper from '@/pages/finance-auto/data.js';
import utiles from '@/components/utiles';

export default {
  components: {
    processStatistics
  },
  mounted(){
     dataHelper.getData().then(data => {
      this.processStatisticsData = data;
    });
    const currentUser = utiles.getCurrentUser();
    this.bName = currentUser.bCompanyName;
  },
  data(){
    return {
      processStatisticsData: [],
      cName: "",
      bName: ""
      }
  },
  methods:{
    rollback(){
      this.$http.get("/tool/statusRoll", {params:{companyName:this.cName.trim(), bName: this.bName}}).then(res => {
        if (res.code == 0){
          return this.$message.success("状态重置成功");
        } else{
          return this.$message.error("状态重置失败");
        }
      });
    }
  }
}
</script>
<style lang="less" scoped>
.smart-bill {
  padding: 0 10px;
  .top-line {
    padding-bottom: 10px;
  }
  .pagination {
    text-align: right;
    padding: 20px 0 0;
  }
}
#cname{
  font-size: 16px;
  line-height: 36px;
}
</style>